package com.tanhua.model.vo;

import com.tanhua.model.domain.UserInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;

/**
 * @program: tanhua
 * @description: 互相喜欢、喜欢、粉丝、谁看过我 - 翻页列表
 * @author: leiyukun
 * @create: 2022-04-03 14:49
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ListVo implements Serializable {
    private Long id; //用户id
    private String avatar; //用户头像
    private String nickname; //昵称
    private String birthday; //生日
    private String gender; //性别
    private String age; //年龄
    private String city; //城市
    private String income; //收入
    private String education; //学历
    private String profession; //行业
    private Integer marriage; //婚姻状态
    private Integer matchRate; //匹配度
    private Boolean alreadyLove;//是否喜欢ta

    public static  ListVo init(UserInfo userInfo, Boolean flag, Double matchRate){

        ListVo vo=new ListVo();
        BeanUtils.copyProperties(userInfo,vo);
        vo.setAlreadyLove(flag);
        vo.setMatchRate(matchRate.intValue());
        return vo;
    }

}
